import { useDispatch, useSelector } from 'react-redux';
import type { TypedUseSelectorHook } from 'react-redux';
import type { RootState, AppDispatch } from './store';

// 自定义的useDispatch hook，带有正确的类型
export const useAppDispatch: () => AppDispatch = useDispatch;

// 自定义的useSelector hook，带有正确的类型
export const useAppSelector: TypedUseSelectorHook<RootState> = useSelector;